<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('plugin_url'))
{
	function plugin_url($uri = '')
	{
	$CI =& get_instance();
	$string= base_url("public/".$uri);
	return $string;
	}
}
if ( ! function_exists('admin_css_url'))
{
    function admin_css_url($uri = '',$class='',$id='')
    {
        $CI =& get_instance();
        if(isset($class)){$class=' class="'.$class.'"';}
        if(isset($id)){$id=' id="'.$id.'"';}
        $css_string= "<link rel='stylesheet' type='text/css' href='".$CI->config->base_url("public/admin/css/".$uri.'.css')."' ".$class." ".$id." media='all'>";
        return $css_string;
    }
}
if ( ! function_exists('admin_js_url'))
{
    function admin_js_url($uri = '')
    {
        $CI =& get_instance();
        $javascript_string='';
        if(isset($uri)){
            $arr_f = array_unique(explode(',',preg_replace("/\.+\//",'',$uri)));
            foreach($arr_f as $v)
            {
                $javascript_string .= "<script type='text/javascript' src='".base_url("public/admin/js/".$v.'.js')."'></script>";
            }
        }
        return $javascript_string;
    }
}
if ( ! function_exists('ueditor_js_url'))
{
    function kde_js_url($uri = '')
    {
        $CI =& get_instance();
        $javascript_string='';
        if(isset($uri)){
            $arr_f = array_unique(explode(',',preg_replace("/\.+\//",'',$uri)));
            foreach($arr_f as $v)
            {
                $javascript_string .= "<script type='text/javascript' src='".base_url("public/admin/kindeditor/".$v.'.js')."'></script>";
            }
        }
        return $javascript_string;
    }
}
if ( ! function_exists('wap_js_url'))
{
    function wap_js_url($uri = '')
    {
        $CI =& get_instance();
        $javascript_string='';
        if(isset($uri)){
            $arr_f = array_unique(explode(',',preg_replace("/\.+\//",'',$uri)));
            foreach($arr_f as $v)
            {
                $javascript_string .= "<script type='text/javascript' src='".base_url("public/wap/js/".$v.'.js')."'></script>";
            }
        }
        return $javascript_string;
    }
}
if ( ! function_exists('wap_css_url'))
{
    function wap_css_url($uri = '',$class='',$id='')
    {
        $CI =& get_instance();
        if(isset($class)){$class=' class="'.$class.'"';}
        if(isset($id)){$id=' id="'.$id.'"';}
        $css_string= "<link rel='stylesheet' type='text/css' href='".$CI->config->base_url("public/wap/css/".$uri.'.css')."' ".$class." ".$id." media='all'>";
        return $css_string;
    }
}
if ( ! function_exists('uploader_url'))
{
    function uploader_css_url($uri = '',$class='',$id='')
    {
        $CI =& get_instance();
        if(isset($class)){$class=' class="'.$class.'"';}
        if(isset($id)){$id=' id="'.$id.'"';}
        $css_string= "<link rel='stylesheet' type='text/css' href='".$CI->config->base_url("public/admin/uploader/".$uri.'.css')."' ".$class." ".$id." media='all'>";
        return $css_string;
    }
}
if ( ! function_exists('uploader_url'))
{
    function uploader_js_url($uri = '',$class='',$id='')
    {
        $CI =& get_instance();
        $javascript_string='';
        if(isset($uri)){
            $arr_f = array_unique(explode(',',preg_replace("/\.+\//",'',$uri)));
            foreach($arr_f as $v)
            {
                $javascript_string .= "<script type='text/javascript' src='".base_url("public/admin/uploader/".$v.'.js')."'></script>";
            }
        }
        return $javascript_string;
    }
}
if ( ! function_exists('wallet_js_url'))
{
    function wallet_js_url($uri = '')
    {
        $CI =& get_instance();
        $javascript_string='';
        if(isset($uri)){
            $arr_f = array_unique(explode(',',preg_replace("/\.+\//",'',$uri)));
            foreach($arr_f as $v)
            {
                $javascript_string .= "<script type='text/javascript' src='".base_url("public/wallet/js/".$v.'.js')."'></script>";
            }
        }
        return $javascript_string;
    }
}
if ( ! function_exists('wallet_css_url'))
{
    function wallet_css_url($uri = '',$class='',$id='')
    {
        $CI =& get_instance();
        if(isset($class)){$class=' class="'.$class.'"';}
        if(isset($id)){$id=' id="'.$id.'"';}
        $css_string= "<link rel='stylesheet' type='text/css' href='".$CI->config->base_url("public/wallet/css/".$uri.'.css')."' ".$class." ".$id." media='all'>";
        return $css_string;
    }
}
if ( ! function_exists('shop_js_url'))
{
    function shop_js_url($uri = '')
    {
        $CI =& get_instance();
        $javascript_string='';
        if(isset($uri)){
            $arr_f = array_unique(explode(',',preg_replace("/\.+\//",'',$uri)));
            foreach($arr_f as $v)
            {
                $javascript_string .= "<script type='text/javascript' src='".base_url("public/shop/js/".$v.'.js')."'></script>";
            }
        }
        return $javascript_string;
    }
}
if ( ! function_exists('shop_css_url'))
{
    function shop_css_url($uri = '',$class='',$id='')
    {
        $CI =& get_instance();
        if(isset($class)){$class=' class="'.$class.'"';}
        if(isset($id)){$id=' id="'.$id.'"';}
        $css_string= "<link rel='stylesheet' type='text/css' href='".$CI->config->base_url("public/shop/css/".$uri.'.css')."' ".$class." ".$id." media='all'>";
        return $css_string;
    }
}